get current platform react native

74

get current platform react native -

// You should import Platform module
// Or use .android.js and .ios.js file extensions

// Example
import { View, Text, Platform } from 'react-native';

function App() {
  return (
    <View style={styles.container}>
      <Text>I'm a(n) {Platform.OS} device</Text>
    </View>
  );
}

export default App;

Comments

Submit
0 Comments